<%@ page import="java.util.List" %>
<%@ page import="entity.MixPFO" %>
<%--
  Created by IntelliJ IDEA.
  User: zhouya
  Date: 2019/6/23/0023
  Time: 0:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="../js/common.js"></script>
    <style>
        table{border: 1px solid gray;border-collapse: collapse;width: 100% }
        td{border: 1px solid gray;text-align: center;}
        .field{width: 150px}
        .title{width: 260px}
        .createDate{width: 240px}
        .operate{width: 120px}
        .roof{width: 80px}
        .operator{width: 90px}
        a {color: #01040c; text-decoration:none;font-size: 14px}
        a:visited {text-decoration:none;}
        a:hover {color:#ba2636;text-decoration:underline;}
        a:active {color:#ba2636;}

        details {margin-left: 25px;font-size: 16px}
        ::-moz-list-bullet {
            font-size: 0;
            float: left;
        }
        summary {
            user-select: none;
            outline: 0;
        }
        summary::after {
            content: '';
            position: absolute;
            width: 12px; height: 12px;
            margin: 4px 0 0 .5ch;
            background-size: 100% 100%;
            transition: transform .2s;
        }
        [open] summary::after {
            transform: rotate(90deg);
        }
        /* 动画效果 */
        details + dl {
            max-height: 0;
            transition: max-height .25s;
            margin: 0 0 1rem;
            overflow: hidden;
        }
        [open] + dl {
            max-height: 80%;
        }
        .three{
            margin-left: 15px;
        }
        /*div{float: left}*/

        #page_box{
            height: 25px;
            border: 1px solid #9cc8ec;
            background-color: white;
        }
    </style>

    <%
        List<MixPFO> mixPFOList=(List<MixPFO>)request.getAttribute("mixPFOList");
        int current_page = (int)request.getAttribute("page");
        int sum = (int)request.getAttribute("sum");
        int num_every_page = (int)request.getAttribute("num_every_page");
        int last_page = (int)request.getAttribute("last_page");
    %>
</head>
<body>
<div>
    请输入文章标题：<input type="text" id="title">
    创建时间：从<input type="datetime" id="begin" onchange="getBegin()" value="2019-06-18 20:29:55" />
    到<input type="datetime" id="end" onchange="getEnd()" value="2019-06-24 20:29:55" />
    <button onclick="getTT()">确认</button>
    <table bgcolor="white">
        <tr>
            <td class="field">栏目名称</td>
            <td class="title">文章标题</td>
            <td class="operator">作者</td>
            <td class="createDate">创建日期</td>
            <td class="roof">是否置顶</td>
            <td class="operate">操作</td>
        </tr>
        <%for(MixPFO mx:mixPFOList){%>
        <tr>
            <td class="field"><%=mx.getFieldName()%></td>
            <td class="title"><%=mx.getTitle()%></td>
            <td class="operator"><%=mx.getOperatorName()%></td>
            <td class="createDate"><%=mx.getCreateDate()%></td>
            <td class="roof"><%=mx.getRoof()%></td>
            <td class="operate">
                <a href="PassageDetailServlet?passageId=<%=mx.getPassageID()%>">详情</a>
                <a>删除</a>
            </td>
        </tr>
        <%}%>
    </table>

        <form action="AdminAllPassageServlet" method="post" id="page_box" >
            <input type="text" style="display: none;" id="current_page" value="<%=current_page%>" />
            <input type="text" style="display: none;" id="last_page" value="<%=last_page%>" />
            <input type="text" style="display: none;" name="page" id="next_page" />

            <input type="submit" style="margin-left:350px;border: 0;width: 9px;background-image: url('../image/first_page.png')" onclick="to_first_page()" id="page_first_btn" value="">
            <input type="submit" style="border: 0;width: 11px;background-image: url('../image/page_up.png')"  onclick="page_up()" id="page_up_btn" value=""> |
            <input type="text" value="<%=current_page %>" style="width: 32px;height: 18px;border: 1px solid #abadb3">
            <span style="color:royalblue">共<%=last_page %>页</span>|
            <input type="submit" style="border: 0;width: 11px;background-image: url('../image/page_down.png')" onclick="page_down()" id="page_down_btn" value="">
            <input type="submit" style="border: 0;width: 9px;background-image: url('../image/last_page.png')" onclick="to_last_page()" id="page_last_btn" value="">
            <select id="pages" onchange="submitForm(); ">
                <%for(int i = 1; i <= last_page; i++){%>
                    <option  value="<%=i %>" <%if(i == current_page){%> selected <%}%> ><%=i %></option>
                <%}%>
            </select>
            <span style="color:royalblue;margin-left: 250px;">
            <%= (current_page-1) * num_every_page + 1%>
            -
            <%=Math.min(current_page * num_every_page, sum)%>
            共<%=sum %>条
            </span>
            <script>page_initial();</script>
        </form>
</div>
</body>
<script type="text/javascript" language="javascript" src="../js/index.js"></script>
</html>
